home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-05 | 1.2 KB | 47 lines | [TEXT/ALFA] |
- // CD Playthrough
- // Version: 1.5 <October 3, 1994>
- // (c) 1994 neg.active.productions, jwang@csua.berkeley.edu <James Wang>
- // ftp://ftp.csua.berkeley.edu/pub/jwang/cool/cd-playthrough-15.hqx
-
- // File: SoundIn.c
- //
- // Contains: Sound input sub-routines
- //
- // Written by: Gary Anwyl, James Wang
- //
- // Description: Opens the default input device (0), gets and sets
- // both the input source ('sour') and playthrough ('plth')
- // options via standard information selectors.
-
-
- #include "main.h"
-
-
- void get_sound_in(SoundSetting *mySnd)
- {
- long siRefNum;
- OSErr err;
-
- err = SPBOpenDevice(0, siReadPermission, &siRefNum);
- if (err) stop_alert(siReadDevFailed);
- err = SPBGetDeviceInfo(siRefNum, 'plth', (Ptr) &(mySnd->siCurrPlth));
- err = SPBGetDeviceInfo(siRefNum, 'sour', (Ptr) &(mySnd->siCurrSour));
- if (err) stop_alert(siGetDevInfoFailed);
-
- SPBCloseDevice(siRefNum);
- }
-
- void set_sound_in(SoundSetting *mySnd)
- {
- long siRefNum;
- OSErr err;
-
- err = SPBOpenDevice(0, siWritePermission, &siRefNum);
- if (err) stop_alert(siWriteDevFailed);
- err = SPBSetDeviceInfo(siRefNum, 'plth', (Ptr) &(mySnd->siWantPlth));
- err = SPBSetDeviceInfo(siRefNum, 'sour', (Ptr) &(mySnd->siWantSour));
- if (err) stop_alert(siSetDevInfoFailed);
-
- SPBCloseDevice(siRefNum);
- }
-